package com.wzh.yuvwater.utils;

import com.libyuv.util.YuvUtil;

public class YuvUtils {
    /**
     * 生成nv21图像镜像(左右翻转)
     */
    public static byte[] nv21Mirror(byte[] rawNv21Data, int width, int height) {

        byte[] newData01 = rawNv21Data.clone();
        YuvUtil.yuvNV21ToI420(rawNv21Data, width, height, newData01);

        byte[] newData03 = rawNv21Data.clone();
        YuvUtil.yuvMirrorI420LeftRight(newData01, width, height, newData03);

        byte[] newData04 = rawNv21Data.clone();
        YuvUtil.yuvI420ToNV21(newData03, width, height, newData04);

        return newData04;
    }
}
